import React, { useState, useEffect } from 'react';
import { PageContainer } from '@ant-design/pro-layout';
import { Card, Table, Form, Input, Button, Select, Space, Tag, Modal, message, Descriptions, Popconfirm, Row, Col, Statistic, DatePicker, Divider, Empty, InputNumber } from 'antd';
const { TextArea } = Input;
import { SearchOutlined, ReloadOutlined, EyeOutlined, EditOutlined, DeleteOutlined, UserOutlined, SaveOutlined, WalletOutlined, GiftOutlined } from '@ant-design/icons';
import { request } from 'umi';
import moment from 'moment';
import SearchForm from './SearchForm';

const { Option } = Select;

// 获取会员列表
const fetchMembers = async (params) => {
  return request('/api/v1/member', {
    method: 'GET',
    params,
  });
};

// 获取会员详情
const fetchMemberDetail = async (id) => {
  return request(`/api/v1/member/${id}`, {
    method: 'GET',
  });
};

// 获取会员积分变动记录
const fetchMemberPointsLog = async (memberId, page = 1, pageSize = 10) => {
  return request('/api/v1/member/points/log', {
    method: 'GET',
    params: {
      member_id: memberId,
      page: page,
      page_size: pageSize
    },
  });
};

// 获取会员余额变动记录
const fetchMemberBalanceLog = async (memberId, page = 1, pageSize = 10) => {
  return request('/api/v1/member/balance/log', {
    method: 'GET',
    params: {
      member_id: memberId,
      page: page,
      page_size: pageSize
    },
  });
};

// 更新会员信息
const updateMember = async (data) => {
  return request(`/api/v1/member/${data.id}`, {
    method: 'PUT',
    data,
  });
};

// 删除会员
const deleteMember = async (id) => {
  return request(`/api/v1/member/${id}`, {
    method: 'DELETE',
  });
};

// 获取会员等级列表
const fetchLevels = async () => {
  return request('/api/v1/member/level', {
    method: 'GET',
    params: { status: 1 },
  });
};

// 调整会员余额
const updateMemberBalance = async (id, data) => {
  return request(`/api/v1/member/${id}/balance`, {
    method: 'PUT',
    data,
  });
};

// 调整会员积分
const updateMemberPoints = async (id, data) => {
  return request(`/api/v1/member/${id}/points`, {
    method: 'PUT',
    data,
  });
};

const MemberList = () => {
  const [members, setMembers] = useState([]);
  const [levels, setLevels] = useState([]);
  const [loading, setLoading] = useState(false);
  const [form] = Form.useForm();
  const [memberForm] = Form.useForm();
  const [pagination, setPagination] = useState({
    current: 1,
    pageSize: 10,
    total: 0,
  });
  const [searchParams, setSearchParams] = useState({});
  const [detailVisible, setDetailVisible] = useState(false);
  const [formVisible, setFormVisible] = useState(false);
  const [balanceFormVisible, setBalanceFormVisible] = useState(false);
  const [pointsFormVisible, setPointsFormVisible] = useState(false);
  const [currentMember, setCurrentMember] = useState(null);
  const [balanceForm] = Form.useForm();
  const [pointsForm] = Form.useForm();
  const [pointsLogs, setPointsLogs] = useState([]);
  const [balanceLogs, setBalanceLogs] = useState([]);
  const [pointsLoading, setPointsLoading] = useState(false);
  const [balanceLoading, setBalanceLoading] = useState(false);
  const [statistics, setStatistics] = useState({
    totalMembers: 0,
    activeMembers: 0,
    newMembersToday: 0,
    averageBalance: 0,
  });

  // 获取会员列表
  const fetchMemberList = async () => {
    try {
      setLoading(true);
      const res = await fetchMembers({
        page: pagination.current,
        pageSize: pagination.pageSize,
        ...searchParams,
      });
      if (res.success) {
        setMembers(res.data.list || []);
        setPagination({
          ...pagination,
          total: res.data.total,
        });
        // 设置统计数据
        if (res.data.statistics) {
          setStatistics(res.data.statistics);
        }
      } else {
        message.error(res.message || '获取会员列表失败');
      }
    } catch (error) {
      console.error('获取会员列表出错:', error);
      message.error('获取会员列表失败');
    } finally {
      setLoading(false);
    }
  };

  // 获取会员等级列表
  const fetchLevelList = async () => {
    try {
      const res = await fetchLevels();
      if (res.success) {
        setLevels(res.data.list || []);
      } else {
        message.error(res.message || '获取会员等级列表失败');
      }
    } catch (error) {
      console.error('获取会员等级列表出错:', error);
      message.error('获取会员等级列表失败');
    }
  };

  useEffect(() => {
    fetchMemberList();
    fetchLevelList();
  }, [pagination.current, pagination.pageSize, searchParams]);

  // 查看会员详情
  const handleViewDetail = async (record) => {
    try {
      setLoading(true);
      setPointsLoading(true);
      setBalanceLoading(true);
      
      // 获取会员详情
      const res = await fetchMemberDetail(record.id);
      if (res.success) {
        setCurrentMember(res.data);
        setDetailVisible(true);
        
        // 获取积分变动记录
        try {
          const pointsRes = await fetchMemberPointsLog(record.id, 1, 5);
          if (pointsRes.success) {
            setPointsLogs(pointsRes.data.list || []);
          } else {
            message.error(pointsRes.message || '获取积分变动记录失败');
          }
        } catch (error) {
          console.error('获取积分变动记录出错:', error);
        } finally {
          setPointsLoading(false);
        }
        
        // 获取余额变动记录
        try {
          const balanceRes = await fetchMemberBalanceLog(record.id, 1, 5);
          if (balanceRes.success) {
            setBalanceLogs(balanceRes.data.list || []);
          } else {
            message.error(balanceRes.message || '获取余额变动记录失败');
          }
        } catch (error) {
          console.error('获取余额变动记录出错:', error);
        } finally {
          setBalanceLoading(false);
        }
      } else {
        message.error(res.message || '获取会员详情失败');
      }
    } catch (error) {
      console.error('获取会员详情出错:', error);
      message.error('获取会员详情失败');
    } finally {
      setLoading(false);
    }
  };

  // 处理编辑会员
  const handleEdit = (record) => {
    setCurrentMember(record);
    memberForm.resetFields();
    memberForm.setFieldsValue({
      name: record.name,
      phone: record.phone,
      email: record.email,
      level_id: record.level_id,
      status: record.status,
      description: record.description,
    });
    setFormVisible(true);
  };
  
  // 处理调整余额
  const handleAdjustBalance = (record) => {
    setCurrentMember(record);
    balanceForm.resetFields();
    setBalanceFormVisible(true);
  };
  
  // 处理调整积分
  const handleAdjustPoints = (record) => {
    setCurrentMember(record);
    pointsForm.resetFields();
    setPointsFormVisible(true);
  };
  
  // 提交调整余额表单
  const handleBalanceFormSubmit = async () => {
    try {
      const values = await balanceForm.validateFields();
      setLoading(true);
      
      const res = await updateMemberBalance(currentMember.id, {
        amount: values.amount,
        description: values.description,
      });
      
      if (res.success) {
        message.success('调整会员余额成功');
        setBalanceFormVisible(false);
        fetchMemberList();
      } else {
        message.error(res.message || '调整会员余额失败');
      }
    } catch (error) {
      console.error('调整会员余额出错:', error);
      message.error('调整会员余额失败');
    } finally {
      setLoading(false);
    }
  };
  
  // 提交调整积分表单
  const handlePointsFormSubmit = async () => {
    try {
      const values = await pointsForm.validateFields();
      setLoading(true);
      
      const res = await updateMemberPoints(currentMember.id, {
        points: values.points,
        description: values.description,
      });
      
      if (res.success) {
        message.success('调整会员积分成功');
        setPointsFormVisible(false);
        fetchMemberList();
      } else {
        message.error(res.message || '调整会员积分失败');
      }
    } catch (error) {
      console.error('调整会员积分出错:', error);
      message.error('调整会员积分失败');
    } finally {
      setLoading(false);
    }
  };

  // 处理删除会员
  const handleDelete = async (id) => {
    try {
      setLoading(true);
      const res = await deleteMember(id);
      if (res.success) {
        message.success('删除会员成功');
        fetchMemberList();
      } else {
        message.error(res.message || '删除会员失败');
      }
    } catch (error) {
      console.error('删除会员出错:', error);
      message.error('删除会员失败');
    } finally {
      setLoading(false);
    }
  };

  // 提交表单
  const handleFormSubmit = async () => {
    try {
      const values = await memberForm.validateFields();
      setLoading(true);
      
      const res = await updateMember({
        id: currentMember.id,
        ...values,
      });
      
      if (res.success) {
        message.success('更新会员信息成功');
        setFormVisible(false);
        fetchMemberList();
      } else {
        message.error(res.message || '更新会员信息失败');
      }
    } catch (error) {
      console.error('更新会员信息出错:', error);
      message.error('更新会员信息失败');
    } finally {
      setLoading(false);
    }
  };

  // 处理搜索
  const handleSearch = (values) => {
    const params = {};
    if (values.keyword) {
      params.keyword = values.keyword;
    }
    if (values.level) {
      params.level = values.level;
    }
    if (values.status) {
      params.status = values.status;
    }
    if (values.dateRange && values.dateRange.length === 2) {
      params.startTime = values.dateRange[0].format('YYYY-MM-DD');
      params.endTime = values.dateRange[1].format('YYYY-MM-DD');
    }
    if (values.consumeTimeRange && values.consumeTimeRange.length === 2) {
      params.consumeStartTime = values.consumeTimeRange[0].format('YYYY-MM-DD');
      params.consumeEndTime = values.consumeTimeRange[1].format('YYYY-MM-DD');
    }
    if (values.balanceRange) {
      if (values.balanceRange[0]) {
        params.minBalance = parseInt(values.balanceRange[0]) * 100;
      }
      if (values.balanceRange[1]) {
        params.maxBalance = parseInt(values.balanceRange[1]) * 100;
      }
    }
    if (values.pointsRange) {
      if (values.pointsRange[0]) {
        params.minPoints = parseInt(values.pointsRange[0]);
      }
      if (values.pointsRange[1]) {
        params.maxPoints = parseInt(values.pointsRange[1]);
      }
    }
    
    setSearchParams(params);
    setPagination({
      ...pagination,
      current: 1,
    });
  };

  // 处理重置
  const handleReset = () => {
    form.resetFields();
    setSearchParams({});
    setPagination({
      ...pagination,
      current: 1,
    });
  };

  // 表格列定义
  const columns = [
    {
      title: '会员ID',
      dataIndex: 'member_no',
      key: 'member_no',
      width: 120,
    },
    {
      title: '姓名',
      dataIndex: 'name',
      key: 'name',
      width: 120,
    },
    {
      title: '手机号',
      dataIndex: 'phone',
      key: 'phone',
      width: 150,
    },
    {
      title: '会员等级',
      dataIndex: 'level_id',
      key: 'level_id',
      width: 120,
      render: (text, record) => {
        // 查找对应的会员等级信息
        const levelInfo = levels.find(level => level.id === record.level_id);
        let color = 'blue';
        
        // 如果找到对应的会员等级，使用其配置的颜色
        if (levelInfo) {
          // 根据会员等级代码设置不同的颜色
          switch (levelInfo.code) {
            case 'gold':
              color = 'gold';
              break;
            case 'platinum':
              color = 'purple';
              break;
            case 'diamond':
              color = 'cyan';
              break;
            default:
              color = 'blue';
          }
          return <Tag color={color}>{levelInfo.name}</Tag>;
        }
        
        // 如果没有找到对应的会员等级，显示原始文本
        return <Tag color={color}>{text || '未知等级'}</Tag>;
      },
    },
    {
      title: '账户余额',
      dataIndex: 'balance',
      key: 'balance',
      width: 120,
      render: (text) => `¥${text.toFixed(2)}`,
    },
    {
      title: '积分',
      dataIndex: 'points',
      key: 'points',
      width: 100,
    },
    {
      title: '状态',
      dataIndex: 'status',
      key: 'status',
      width: 100,
      render: (text, record) => (
        <Tag color={record.status === 1 ? 'green' : 'red'}>
          {text===1?'正常':'禁用'}
        </Tag>
      ),
    },
    {
      title: '注册时间',
      dataIndex: 'created_at',
      key: 'created_at',
      width: 180,
      render: (text) => moment(text*1000).format('YYYY-MM-DD HH:mm:ss'),
    },
    {
      title: '最后消费',
      dataIndex: 'last_consume_time',
      key: 'last_consume_time',
      width: 180,
      render: (text) => moment(text*1000).format('YYYY-MM-DD HH:mm:ss'),
    },
    {
      title: '操作',
      key: 'action',
      render: (_, record) => (
        <Space size="middle">
          <Button 
            type="link" 
            icon={<EyeOutlined />} 
            onClick={() => handleViewDetail(record)}
          >
            详情
          </Button>
          <Button 
            type="link" 
            icon={<EditOutlined />} 
            onClick={() => handleEdit(record)}
          >
            编辑
          </Button>
          <Button 
            type="link" 
            icon={<WalletOutlined />} 
            onClick={() => handleAdjustBalance(record)}
          >
            调整余额
          </Button>
          <Button 
            type="link" 
            icon={<GiftOutlined />} 
            onClick={() => handleAdjustPoints(record)}
          >
            调整积分
          </Button>
          <Popconfirm
            title="确定要删除此会员吗？"
            onConfirm={() => handleDelete(record.id)}
            okText="确定"
            cancelText="取消"
          >
            <Button 
              type="link" 
              icon={<DeleteOutlined />} 
              danger
            >
              删除
            </Button>
          </Popconfirm>
        </Space>
      ),
    },
  ];

  // 处理表格变化
  const handleTableChange = (pagination, filters, sorter) => {
    setPagination(pagination);
  };

  return (
    <PageContainer>
      <Card style={{ marginBottom: 24 }}>
        <Row gutter={24} style={{ marginBottom: 24 }}>
          <Col span={6}>
            <Card>
              <Statistic 
                title="会员总数" 
                value={statistics.totalMembers} 
                prefix={<UserOutlined />}
              />
            </Card>
          </Col>
          <Col span={6}>
            <Card>
              <Statistic 
                title="活跃会员" 
                value={statistics.activeMembers} 
                valueStyle={{ color: '#3f8600' }}
              />
            </Card>
          </Col>
          <Col span={6}>
            <Card>
              <Statistic 
                title="今日新增" 
                value={statistics.newMembersToday} 
                valueStyle={{ color: '#1890ff' }}
              />
            </Card>
          </Col>
          <Col span={6}>
            <Card>
              <Statistic 
                title="平均余额" 
                value={(statistics.averageBalance / 100).toFixed(2)} 
                prefix="¥"
              />
            </Card>
          </Col>
        </Row>

        <SearchForm form={form} onSearch={handleSearch} onReset={handleReset} levels={levels} />
        
        <Table
          columns={columns}
          dataSource={members}
          rowKey="id"
          loading={loading}
          pagination={pagination}
          onChange={handleTableChange}
          scroll={{ x: 1500 }}
        />
      </Card>

      {/* 会员详情弹窗 */}
      <Modal
        title="会员详情"
        visible={detailVisible}
        onCancel={() => setDetailVisible(false)}
        footer={null}
        width={700}
      >
        {currentMember && (
          <>
            <Descriptions bordered column={2}>
              <Descriptions.Item label="会员ID">{currentMember.member_no}</Descriptions.Item>
              <Descriptions.Item label="姓名">{currentMember.name}</Descriptions.Item>
              <Descriptions.Item label="手机号">{currentMember.phone}</Descriptions.Item>
              <Descriptions.Item label="邮箱">{currentMember.email || '-'}</Descriptions.Item>
              <Descriptions.Item label="会员等级">
                {(() => {
                  // 查找对应的会员等级信息
                  const levelInfo = levels.find(level => level.id === currentMember.level_id);
                  let color = 'blue';
                  let levelName = currentMember.levelName || '未知等级';
                  // 如果找到对应的会员等级，使用其配置的颜色和名称
                  if (levelInfo) {
                    // 根据会员等级代码设置不同的颜色
                    switch (levelInfo.code) {
                      case 'gold':
                        color = 'gold';
                        break;
                      case 'platinum':
                        color = 'purple';
                        break;
                      case 'diamond':
                        color = 'cyan';
                        break;
                      default:
                        color = 'blue';
                    }
                    levelName = levelInfo.name;
                  }
                  
                  return <Tag color={color}>{levelName}</Tag>;
                })()}
              </Descriptions.Item>
              <Descriptions.Item label="账户余额">
                ¥{(currentMember.balance / 100).toFixed(2)}
              </Descriptions.Item>
              <Descriptions.Item label="积分">{currentMember.points || 0}</Descriptions.Item>
              <Descriptions.Item label="状态">
                <Tag color={currentMember.status === 1 ? 'green' : 'red'}>
                  {currentMember.status === 1 ? '正常' : '禁用'}
                </Tag>
              </Descriptions.Item>
              <Descriptions.Item label="注册时间">{moment(currentMember.created_at*1000).format('YYYY-MM-DD HH:mm:ss')}</Descriptions.Item>
              <Descriptions.Item label="最后登录时间">{moment(currentMember.last_login_at*1000).format('YYYY-MM-DD HH:mm:ss')}</Descriptions.Item>
              <Descriptions.Item label="最后消费时间">{moment(currentMember.last_consume_time*1000).format('YYYY-MM-DD HH:mm:ss')}</Descriptions.Item>
              <Descriptions.Item label="备注">{currentMember.remark || '-'}</Descriptions.Item>
            </Descriptions>
            <Divider orientation="left">积分变动</Divider>
            <Table 
              dataSource={pointsLogs} 
              rowKey="id"
              pagination={false}
              size="small"
              loading={pointsLoading}
              columns={[
                { 
                  title: '变动数量', 
                  dataIndex: 'points', 
                  key: 'points', 
                  render: (text) => text > 0 ? `+${text}` : text 
                },
                { 
                  title: '变动类型', 
                  dataIndex: 'type', 
                  key: 'type',
                  render: (text) => {
                    const typeMap = {
                      1: '消费获得',
                      2: '管理员调整',
                      3: '活动奖励',
                      4: '积分兑换',
                      5: '积分过期'
                    };
                    return typeMap[text] || '其他';
                  }
                },
                { 
                  title: '变动说明', 
                  dataIndex: 'description', 
                  key: 'description',
                  ellipsis: true
                },
                { 
                  title: '变动时间', 
                  dataIndex: 'created_at', 
                  key: 'created_at',
                  render: (text) => moment(text*1000).format('YYYY-MM-DD HH:mm:ss')
                },
              ]}
              locale={{
                emptyText: <Empty description="暂无积分记录" />
              }}
            />
            
            <Divider orientation="left">余额变动</Divider>
            <Table 
              dataSource={balanceLogs} 
              rowKey="id"
              pagination={false}
              size="small"
              loading={balanceLoading}
              columns={[
                { 
                  title: '变动金额', 
                  dataIndex: 'amount', 
                  key: 'amount', 
                  render: (text) => {
                    const amount = text;
                    return amount > 0 ? `+¥${amount.toFixed(2)}` : `¥${amount.toFixed(2)}`;
                  }
                },
                { 
                  title: '变动类型', 
                  dataIndex: 'type', 
                  key: 'type',
                  render: (text) => {
                    const typeMap = {
                      1: '充值',
                      2: '消费',
                      3: '退款',
                      4: '管理员调整',
                      5: '活动奖励'
                    };
                    return typeMap[text] || '其他';
                  }
                },
                { 
                  title: '变动说明', 
                  dataIndex: 'description', 
                  key: 'description',
                  ellipsis: true
                },
                { 
                  title: '变动时间', 
                  dataIndex: 'created_at', 
                  key: 'created_at',
                  render: (text) => moment(text*1000).format('YYYY-MM-DD HH:mm:ss')
                },
              ]}
              locale={{
                emptyText: <Empty description="暂无余额记录" />
              }}
            />
          </>
        )}
        <Divider />
      </Modal>
      {/* 编辑会员弹窗 */}
      <Modal
        title="编辑会员"
        visible={formVisible}
        onCancel={() => setFormVisible(false)}
        footer={null}
        width={700}
      >
        <Form
          form={memberForm}
          name="editMemberForm"
          onFinish={handleFormSubmit}
          layout="vertical"
          preserve={false}
        >
          <Form.Item name="name" label="姓名" rules={[{ required: true, message: '请输入会员姓名' }]}>
            <Input />
          </Form.Item>
          <Form.Item name="phone" label="手机号" rules={[{ required: true, message: '请输入会员手机号' }]}>
            <Input />
          </Form.Item>
          <Form.Item name="email" label="邮箱">
            <Input />
          </Form.Item>
          <Form.Item name="level_id" label="会员等级" rules={[{ required: true, message: '请选择会员等级' }]}>
            <Select>
              {levels.map(level => (
                <Option key={level.id} value={level.id}>{level.name}</Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item name="status" label="状态" rules={[{ required: true, message: '请选择会员状态' }]}>
            <Select>
              <Option key={1} value={1}>正常</Option>
              <Option key={0} value={0}>已禁用</Option>
            </Select>
          </Form.Item>
          
          <Button type="primary" htmlType="submit" icon={<SaveOutlined />} style={{ marginTop: 24 }}>
              保存
            </Button>
            <Button onClick={() => setFormVisible(false)} style={{ marginTop: 24, marginLeft: 8 }}>
              取消
            </Button>
            <Divider />
        </Form>
      </Modal>
      
      {/* 调整余额弹窗 */}
      <Modal
        title="调整会员余额"
        visible={balanceFormVisible}
        onCancel={() => setBalanceFormVisible(false)}
        footer={null}
        width={500}
      >
        {currentMember && (
          <Form
            form={balanceForm}
            name="adjustBalanceForm"
            onFinish={handleBalanceFormSubmit}
            layout="vertical"
            preserve={false}
          >
            <Form.Item
              label={<span>当前余额: <span style={{ color: '#1890ff' }}>¥{(currentMember.balance / 100).toFixed(2)}</span></span>}
            >
              <div>会员: {currentMember.name} ({currentMember.phone})</div>
            </Form.Item>
            
            <Form.Item
              name="amount"
              label="调整金额"
              rules={[
                { required: true, message: '请输入调整金额' },
                { type: 'number', message: '请输入有效的金额' },
                { validator: (_, value) => value !== 0 ? Promise.resolve() : Promise.reject('调整金额不能为0') }
              ]}
              extra="正数为增加余额，负数为减少余额"
            >
              <InputNumber
                style={{ width: '100%' }}
                placeholder="请输入调整金额"
                formatter={value => `¥ ${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')}
                parser={value => value.replace(/¥\s?|(,*)/g, '')}
                precision={2}
              />
            </Form.Item>
            
            <Form.Item
              name="description"
              label="调整原因"
              rules={[{ required: true, message: '请输入调整原因' }]}
            >
              <TextArea rows={4} placeholder="请输入调整原因" />
            </Form.Item>
            
            <Button type="primary" htmlType="submit" icon={<SaveOutlined />} style={{ marginTop: 24 }}>
              确认调整
            </Button>
            <Button onClick={() => setBalanceFormVisible(false)} style={{ marginTop: 24, marginLeft: 8 }}>
              取消
            </Button>
          </Form>
        )}
      </Modal>
      
      {/* 调整积分弹窗 */}
      <Modal
        title="调整会员积分"
        visible={pointsFormVisible}
        onCancel={() => setPointsFormVisible(false)}
        footer={null}
        width={500}
      >
        {currentMember && (
          <Form
            form={pointsForm}
            name="adjustPointsForm"
            onFinish={handlePointsFormSubmit}
            layout="vertical"
            preserve={false}
          >
            <Form.Item
              label={<span>当前积分: <span style={{ color: '#1890ff' }}>{currentMember.points || 0}</span></span>}
            >
              <div>会员: {currentMember.name} ({currentMember.phone})</div>
            </Form.Item>
            
            <Form.Item
              name="points"
              label="调整积分"
              rules={[
                { required: true, message: '请输入调整积分' },
                { type: 'number', message: '请输入有效的积分' },
                { validator: (_, value) => value !== 0 ? Promise.resolve() : Promise.reject('调整积分不能为0') }
              ]}
              extra="正数为增加积分，负数为减少积分"
            >
              <InputNumber
                style={{ width: '100%' }}
                placeholder="请输入调整积分"
                precision={0}
              />
            </Form.Item>
            
            <Form.Item
              name="description"
              label="调整原因"
              rules={[{ required: true, message: '请输入调整原因' }]}
            >
              <TextArea rows={4} placeholder="请输入调整原因" />
            </Form.Item>
            
            <Button type="primary" htmlType="submit" icon={<SaveOutlined />} style={{ marginTop: 24 }}>
              确认调整
            </Button>
            <Button onClick={() => setPointsFormVisible(false)} style={{ marginTop: 24, marginLeft: 8 }}>
              取消
            </Button>
          </Form>
        )}
      </Modal>
    </PageContainer>
  );
};
export default MemberList;